package com.qiwenshare.file.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.annotations.Comment;

import javax.persistence.*;

/**
 * 存储信息类
 */
@Data
@Table(name = "storage", uniqueConstraints = {
        @UniqueConstraint(name = "userid_index", columnNames = {"userId"})
})
@Entity
@TableName("storage")
public class StorageBean {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    //@Column(columnDefinition="bigint(20)")
    //@TableId(type = IdType.AUTO)
    @TableId
    private Long storageId;

    @Column(length = 20)
    private String userId;

    @Comment("占用存储大小")
    //@Column(columnDefinition="bigint(20)")
    private Long storageSize;


    @Comment("总存储大小")
    //@Column(columnDefinition="bigint(20)")
    private Long totalStorageSize;

    @Comment("修改时间")
    @Column(length = 25)
    private String modifyTime;

    @Comment("修改用户id")
    //@Column(columnDefinition="bigint(20)")
    private Long modifyUserId;

    public StorageBean() {

    }

    public StorageBean(String userId) {
        this.userId = userId;
    }

}
